]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Close inhibitors that finished creation after uninhibition
authorSebastian Keller <skeller@gnome.org>
Thu, 5 Aug 2021 05:22:07 +0000 (07:22 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 16 Aug 2021 00:28:52 +0000 (00:28 +0000)
There was a potential issue when suspend was inhibited and immediately
uninhibited again before the creation of the inhibitor has finished.
Then the new inhibitor would be kept active.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1927>

js/ui/screenShield.js

index de8b7f409e20adba4f9e436f1ae6feec971c4fc8..04353d93b5222d8ebcb3eccd2b8444ae4c13c48e 100644 (file)
@@ -224,6 +224,12 @@ var ScreenShield = class {
                         else
                             this._inhibitor = inhibitor;
                     }
+
+                    // Handle uninhibits that happened after the start
+                    if (!this._inhibited) {
+                        this._inhibitor?.close(null);
+                        this._inhibitor = null;
+                    }
                 });
         } else {
             this._inhibitor?.close(null);